package org.puppet.demo.tank.explode;

import org.puppet.demo.tank.R;
import org.puppet.demo.tank.puppet.Bullet;
import org.puppet.demo.tank.puppet.Explode;
import org.puppet.game.base.PuppetUtils;
import org.puppet.game.element.PuppetInfo;
import org.puppet.game.element.PuppetInfo.AnimInfo;

import android.content.Resources;

public class DualExplode extends Explode {

	public DualExplode(Bullet bullet) {
		super(bullet);
		//TODO config
		//this.acceY = -0.0028f;
	}
	
	@Override
	protected PuppetInfo getAnimationInfo(Resources res) {
		PuppetInfo info = new PuppetInfo();
		info.setBitmap(PuppetUtils.createBitmap(res, R.drawable.explode));
		info.setFrameWidth(84);
		info.setFrameHeight(64);
		
		long[] ds = new long[24];
		for (int i = 0; i < 24; i++) {
			ds[i] = 8;
		}
		
		info.setAnims(new AnimInfo[]{
				new AnimInfo(0, ds, 42, 32)
		});
		
		return info;
	}

	@Override
	public void onAnimationEnd(int actionNo) {
		this.die();
	}
	
}
